<template>
  <view class="my-container">
    <u-field
      v-model="amount"
      label="提现金额"
      type="number"
      placeholder="请填写提现金额"
    >
    </u-field>
    <u-button type="primary" :ripple="true" @click="onSubmit">提现</u-button>
  </view>
</template>

<script>
export default {
  data() {
    return {
      amount: ''
    };
  },
  created(){
    
  },
  methods: {
    onSubmit() {
      const amount = this.amount
      this.$http({
        url: '/wallet/postAddWithdraw',
        data: { amount },
      }).then(res => {
        console.log(0, res)
        uni.showToast({
          title: '提现成功'
        })
        setTimeout(() => {
          uni.navigateBack()
        }, 1500)
      }).catch(err => {
        uni.showToast({
          title: err.msg,
          icon: 'none'
        })
        console.log(1, err)
      })
    },
  },
};
</script>

<style lang='less' scoped>
.my-container {
  padding: 20rpx 30rpx;
  
}
</style>